/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.giangnd.btvn1;

import java.util.Scanner;

/**
 *
 * @author GIANG
 */
public class B2M2 {
    static void nhap(float a[], int n) {
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < n; i++) {
			System.out.print("\nA[" + i + "]=");
			a[i] = sc.nextFloat();
		}
	}

	static void dem(float a[], int n) {
		for (int i = 0; i < n; i++) {
			int dem = 1;
			if (a[i] != -1) {

				for (int j = i + 1; j < n; j++)
					if (a[i] == a[j]) {
						dem++;
						a[j] = -1;
					}
				System.out.println(a[i] + " " + dem);
			}
		}
	}

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n;
		System.out.println("n=");
		n = sc.nextInt();
		float a[] = new float[n];
		nhap(a, n);
		dem(a, n);
	}
}
